package com.foreknow.demo5;

public class Test {
    public static void main(String[] args) {
        int[] array = new int[5];
        for(int i = 0;i<array.length;i++) {
            array[i] = (int) (Math.random() * (9999 - 1000)) + 1000;
        }
        int cardNumber = (int) (Math.random() * (9999 - 1000)) + 1000;;
        //遍历数组
        boolean isRight = false;
        for(int i = 0;i<array.length;i++) {
            if(cardNumber == array[i]) { //判断会员卡号是否与数组中的元素相等
                isRight = true; //幸运会员
                break;
            }
        }
        if(isRight) {
            System.out.println("您是幸运会员.......");
        }else {
            System.out.println("不是......");
        }

    }
}
